#ifndef CREDITCARDTABLEMODEL_H
#define CREDITCARDTABLEMODEL_H

#include <QList>
#include <QAbstractTableModel>
#include <QStyleOptionViewItem>
#include <QTableView>
#include "creditcardprofile.h"


class CreditCardTableModel : public QAbstractTableModel
{
    Q_OBJECT
public:
    CreditCardTableModel();
    ~CreditCardTableModel();
    QList<CreditCardProfile*> list;

    QStringList             header_data;

    virtual QVariant        data(const QModelIndex &index, int role) const;
    virtual bool            setData(const QModelIndex &index, const QVariant &value, int role);

    virtual int             rowCount(const QModelIndex &parent=QModelIndex()) const;
    virtual int             columnCount(const QModelIndex &parent) const;

    virtual QVariant        headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const;
    virtual Qt::ItemFlags   flags(const QModelIndex &index) const;
    CreditCardTableModel&   operator=(CreditCardTableModel &other);
signals:
    void                    createNewRow(int row);
    void                    removedRow(int row);
public slots:
    void                    addRow();
    void                    addRow(CreditCardProfile *profile);
    bool                    removeRows(QObject *view);
    void                    clearAll();
};

#endif // CREDITCARDTABLEMODEL_H
